<?php
namespace api\user\validate;
use think\Validate;


class UserValidate extends Validate
{
    protected $rule = [
        'username'        =>  'require',
	    'password'      =>  'require',
        'user_info_name'        =>  'require',
        'user_info_phone'        =>  'require',
        'user_info_address'        =>  'require',
        'user_id'        =>  'require',
        'token'        =>  'require',
    ];
    protected $message = [
        'username.require'    =>  '请输入手机号,邮箱!',
	    'password.require'  =>  '请输入您的密码!',
        'user_info_name.require'  =>  '请输入用户名称!',
        'user_info_phone.require'  =>  '请输入联系电话!',
        'user_info_address.require'  =>  '请输入地址!',
        'user_id.require'  =>  '用户ID不能为空!',
        'token.require'  =>  'token不能为空!',
    ];

    protected $scene = [
        'AdminStrategy_addUser'  => [ 'username' , 'password'],
        'AdminStrategy_editPost'  => ['password'],
        'AdminStrategy_killUser'  => [ 'user_id'],
        'AdminStrategy_releaseUser'  => [ 'user_id'],
        'AdminStrategy_getUserInfo'  => [ 'user_id'],
        'AdminStrategy_getAllUser'  => ['token'],
        'AgentStrategy_getAllUser'  => ['token'],
        'AgentStrategy_killUser'  => [ 'user_id'],
        'AgentStrategy_getUserInfo'  => [ 'user_id'],
        'AgentStrategy_releaseUser'  => [ 'user_id'],
        'AgentStrategy_addUser'  => [ 'username' , 'password','user_info_name','user_info_phone','user_info_address'],
        'AgentStrategy_editPost'  => ['user_info_name','user_info_phone','user_info_address'],
    ];
}
